package com.nanhang.controller;

import com.nanhang.common.util.R;
import com.nanhang.entity.Classes;
import com.nanhang.service.IClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2025-01-07
 */
@RestController
@RequestMapping("/classes")
public class ClassesController {

    @Autowired
    private IClassesService classesservice;

    @GetMapping("/list")
    public R findAllCLASS(){
        List<Classes> list = classesservice.list();
        return R.ok().data("classes",list);
    }
}
